From: Florian Müllner Date: Sat, 30 Jul 2022 12:34:12 +0000 (+0200) Subject: status/brightness: Hide when proxy has no owner X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~461^2^2~212 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=87e4eda46db625eba4388aaea9d6503ec518b594;p=gnome-shell.git status/brightness: Hide when proxy has no owner Properties are null while a proxy has no owner. Javascript helpfully coerces that into `Number(null)` (a.k.a. 0), so we end up with a broken slider. Explicitly check that the value is an integer before doing the comparison to catch that case. Part-of: --- diff --git a/js/ui/status/brightness.js b/js/ui/status/brightness.js index aa6020660..61258bd59 100644 --- a/js/ui/status/brightness.js +++ b/js/ui/status/brightness.js @@ -67,7 +67,8 @@ class Indicator extends PanelMenu.SystemIndicator { } _sync() { - let visible = this._proxy.Brightness >= 0; + const brightness = this._proxy.Brightness; + const visible = Number.isInteger(brightness) && brightness >= 0; this._item.visible = visible; if (visible) this._changeSlider(this._proxy.Brightness / 100.0);